class Card:
    card_name='浦发银行'
    def __init__(self,card_id,password,name):
        self.id=card_id
        self.pwd=password
        self.name=name
        self.__price=0
    def __login(self):
        tag=0
        id=int(input('输入卡号：'))
        pwd=int(input('输入密码：'))
        if id == self.id and pwd == self.pwd:
            tag=1
            print('登录成功')
        return tag
    def save_money(self):
        tag=self.__login()
        if tag==1:
            money=float(input('输入你的存款金额：'))
            self.__price+=money
            print(f'存款{money},余额为{self.__price}')
    def get_money(self):
        tag=self.__login()
        if tag==1:
            money=float(input('输入你要取的钱数：'))
            if money<=self.__price:
                self.__price-=money
                print(f'取款{money}，余额为{self.__price}')
            else:
                print('余额不足')
    def set_price(self,money):
        tag=self.__login()
        if tag==1:
            if money>0:
                self.__price+=money
                print(f'初始化成功，余额为{self.__price}')
    def get_price(self):
        tag = self.__login()
        if tag == 1:
            return self.__price
if __name__ == '__main__':
    card1 = Card(1, 123, 'zhangsan')
    card1.set_price(10)
    print(card1.get_price())





